package com.hmall.search.service.Impl;

import cn.hutool.json.JSON;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hmall.common.client.SearchClient;
import com.hmall.common.dto.PageDTO;
import com.hmall.common.pojo.RequestParams;
import com.hmall.search.mapper.SearchMapper;
import com.hmall.search.pojo.Item;
import com.hmall.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * TODO
 *
 * @Author mr.ma
 * @Date 2024/11/21 20:29
 */
@Service
public class SearchServiceImpl extends ServiceImpl<SearchMapper, Item> implements SearchService {

    @Autowired
    private SearchMapper searchMapper;

    @Autowired
    private SearchClient searchClient;

    @Override
    public JSON filter(RequestParams requestParams) {
        JSON filters = searchClient.filters(requestParams);
        return filters;
    }

    @Override
    public PageDTO list1(RequestParams requestParams) {
        return searchClient.list(requestParams);
    }
}
